package facade;

import model.Customer;
import model.Enterprise;
import model.Person;
import model.type.SubjectType;
import db.ImbiConnection;

public class CustomerFacade {
	public static void makeCustomer(Person p){
		makeCustomer(p.getId(), SubjectType.PERSON);
	}
	
	public static void makeCustomer(Enterprise e){
		makeCustomer(e.getId(), SubjectType.ENTERPRISE);
	}
	
	private static void makeCustomer(int id, int type){
		Customer customer = new Customer(
			0,
			id,
			type
		);
		ImbiConnection.getCustomerDAO().insert(customer);
	}
}
